<template>
  <div id="app">
    <!-- 静态路由,直接绑定 -->
    <router-link to="/">去 A 组件</router-link>
    <router-link to="/b">去 B 组件</router-link>
    <!-- <router-link to="/c">去 C 组件</router-link>
    <router-link to="/d">去 D 组件</router-link> -->
    <!-- 动态路由依仗于 store 提供  -->
    <router-link
      v-for="route in userRoutes"
      :to="route.path"
      :key="route.path"
      >{{ route.name }}</router-link
    >
    <router-view></router-view>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  name: "App",
  computed: {
    ...mapGetters(["userRoutes"]),
  },
};
</script>

<style>
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
